package com.whenjun.entity;

import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 请求记录
 * </p>
 *
 * @author whenjun
 * @since 2023-11-08
 */
@ApiModel(value = "Request对象", description = "请求记录")
public class Request implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    @ApiModelProperty("请求ip")
    private String ip;

    @ApiModelProperty("请求方法")
    private String method;

    @ApiModelProperty("请求路径")
    private String uri;

    @ApiModelProperty("请求头")
    private String requestHeader;

    @ApiModelProperty("请求体")
    private String requestBody;

    @ApiModelProperty("返回信息")
    private String responseBody;

    @ApiModelProperty("异常信息")
    private String exception;

    @ApiModelProperty("请求时间")
    private LocalDateTime requestTime;

    @ApiModelProperty("链接请求参数")
    private String uriParam;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getRequestHeader() {
        return requestHeader;
    }

    public void setRequestHeader(String requestHeader) {
        this.requestHeader = requestHeader;
    }

    public String getRequestBody() {
        return requestBody;
    }

    public void setRequestBody(String requestBody) {
        this.requestBody = requestBody;
    }

    public String getResponseBody() {
        return responseBody;
    }

    public void setResponseBody(String responseBody) {
        this.responseBody = responseBody;
    }

    public String getException() {
        return exception;
    }

    public void setException(String exception) {
        this.exception = exception;
    }

    public LocalDateTime getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(LocalDateTime requestTime) {
        this.requestTime = requestTime;
    }

    public String getUriParam() {
        return uriParam;
    }

    public void setUriParam(String uriParam) {
        this.uriParam = uriParam;
    }

    @Override
    public String toString() {
        return "Request{" +
            "id = " + id +
            ", ip = " + ip +
            ", method = " + method +
            ", uri = " + uri +
            ", requestHeader = " + requestHeader +
            ", requestBody = " + requestBody +
            ", responseBody = " + responseBody +
            ", exception = " + exception +
            ", requestTime = " + requestTime +
            ", uriParam = " + uriParam +
        "}";
    }
}
